package com.eamois.action.sys;

import java.util.Collection;

import com.eamois.action.BaseAction;
import com.eamois.domain.sys.Equipment;
import com.eamois.domain.sys.EquipmentType;
import com.eamois.service.sys.EquipmentService;
import com.eamois.service.sys.EquipmentTypeService;
import com.eamois.util.ServiceFactory;

public class EquipmentAction extends BaseAction{
	private EquipmentTypeService equipmentTypeService;
	private EquipmentService equipmentService;
	
	public EquipmentAction() {
		equipmentTypeService = (EquipmentTypeService) ServiceFactory.getInstance().getBean("equipmentTypeService");
		equipmentService = (EquipmentService) ServiceFactory.getInstance().getBean("equipmentService");
	}
	
	public EquipmentType getEquipmentType(String name,String equitType)
	{
		return this.getEquipmentTypeService().getEquipmentType(name, equitType);
	}
	
	public Collection<String> findEquipmentIds(){
		return this.getEquipmentService().findEquipmentIds();
	}
	public boolean findEquipment(String id){
		return this.getEquipmentService().findEquipment(id);
	}
	public Equipment findEquipmentById(String id){
		return this.getEquipmentService().findEquipmentById(id);
	}
	
	public Collection<Equipment> findEquipments(String name,String number,String spec,String model,String kind,String remark){
		return this.getEquipmentService().findEquipment(name, number,spec,model, kind, remark);
	}
	public Collection<EquipmentType> findRootEquipmentType() {
		return this.getEquipmentTypeService().findRootEquipmentType();
	}
	public EquipmentType findTypeByName(String name,String type) {
		return this.getEquipmentTypeService().findTypeByName(name,type);
	}
	public Collection<EquipmentType> findChildEquipmentType(EquipmentType equipmentType) {
		return this.getEquipmentTypeService().findChildEquipmentType(equipmentType);
	}
	
	public void saveEquipmentType(EquipmentType equipmentType) {
		this.getEquipmentTypeService().save(equipmentType);
	}
	
	public Collection<Equipment> findEquipment(EquipmentType equipmentType) {
		return this.getEquipmentService().findEquipment(equipmentType);
	}
	
	public Collection<Equipment> findAllEquipment() {
		return this.getEquipmentService().findAllEquipment();		
	}
	public Collection<Equipment> findByBelongId(String id){
		return this.getEquipmentService().findByBelongId(id);
	}
	public Collection<Equipment> findEquipment(String name,String number,String spec,String kind,boolean isLike) {
		return this.getEquipmentService().findEquipment(name, number,spec,kind,isLike);
	}
	public Collection<Equipment> findEquipment(String name,String code,String kind){
		return this.getEquipmentService().findEquipment(name, code, kind);
	}
	public Collection<Equipment> findEquipment(String name,String code,EquipmentType equipmentType) {
		return this.getEquipmentService().findEquipment(name, code, equipmentType);
	}
	public Collection<Equipment> findEquipment(String name,String code,String kind,EquipmentType equipmentType) {
		return this.getEquipmentService().findEquipment(name, code, kind, equipmentType);
	}
	public Collection<Equipment> findEquipmentByNameAndKind(String name,String kind){
		return this.getEquipmentService().findEquipmentByNameAndKind(name, kind);
	}
	
	public void removeEquipmentType(EquipmentType equipmentType) {
		this.getEquipmentTypeService().remove(equipmentType);
	}
	
	public void saveEquipment(Equipment equipment) {
		this.getEquipmentService().save(equipment);
	}
	
	public void removeEquipment(Equipment equipment) {
		this.getEquipmentService().remove(equipment);
	}
	
	public EquipmentTypeService getEquipmentTypeService() {
		return equipmentTypeService;
	}

	public void setEquipmentTypeService(EquipmentTypeService equipmentTypeService) {
		this.equipmentTypeService = equipmentTypeService;
	}

	public EquipmentService getEquipmentService() {
		return equipmentService;
	}

	public void setEquipmentService(EquipmentService equipmentService) {
		this.equipmentService = equipmentService;
	}
	
}
